# Contributor: lauren n. liberda <lauren@selfisekai.rocks>
maintainer="lauren n. liberda <lauren@selfisekai.rocks>"
pkgname=py3-backoff
pkgver=2.2.1
pkgrel=0
pkgdesc="Function decorators for configurable backoff and retry"
url="https://github.com/litl/backoff"
arch="noarch"
license="MIT"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest-asyncio
	py3-responses
	pytest
	"
subpackages="$pkgname-pyc $pkgname-doc"
source="https://github.com/litl/backoff/archive/v$pkgver/py3-backoff-$pkgver.tar.gz"
builddir="$srcdir/backoff-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	install -Dm755 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

sha512sums="
ed98c50d544d4ac3214b03005e5d183b0aeefd568c89769b59115ecc67ba7f7ea29a58e6ebf8488026a95ff2a1155e798782b04bebc9315c6a3682540bb38dff  py3-backoff-2.2.1.tar.gz
"
